<?php

declare(strict_types=1);

namespace DbModels\RBAC;



/**
 * @property int $id 
 * @property string $auth_key 
 * @property string $username 
 * @property string $realname 
 * @property int $state 
 * @property string $password 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $avatar 
 */
class Admin extends \App\Abstract\Model
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'rbac_admins';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = [];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'state' => 'integer'];


    public function roles(): \Hyperf\Database\Model\Relations\HasMany
    {
        return $this->hasMany(RoleAdmin::class,'uid','id');
    }
}
